<%-- 
    Document   : newExercise
    Created on : 27-feb-2012, 19:50:23
    Author     : Tarde
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page language="java"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<div id="newExer">
    <table align="center" cellspacing="10px" width="250px">
        <html:form action="/NewExercise">
            <tr>
                <td>
                    <html:hidden property="idejercicio"/>
                    <bean:message key="titulo.txt"/>
                </td>
            </tr>
            <tr>
                <td><html:text property="titulo" size="80"/></td>
            </tr>
            <tr>
                <td><html:errors property="titulo"/></td>
            </tr>
            <tr>
                <td><bean:message key="descripcion.txt"/></td>
            </tr>
            <tr>
                <td><html:textarea rows="5" cols="65" property="descripcion"/></td>
            </tr>
            <tr>
                <td><html:errors property="descripcion"/></td>
            </tr>
            <tr>
                <td><bean:message key="tema.txt"/></td>
            </tr>
            <tr>

                <td><html:select property="tema">
                        <c:forEach var="niv" items="${usuario.usualengs}">
                            <logic:present name="temas" >
                                <logic:iterate id="temaEjercicio" name="temas" length="${niv.nivel.idnivel}">
                                    <html:option value="${temaEjercicio.idtema}">${temaEjercicio.tema}</html:option>  
                                </logic:iterate>
                            </logic:present> 
                        </c:forEach>
                    </html:select></td>
            </tr>
            <tr>
                <td><html:submit><bean:message key="guardarejercicio.sub"/></html:submit></td>
                </tr>
                <tr>
                    <td><html:errors property="result"/></td>
            </tr>
        </html:form>

    </table>
</div>    